import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    songItem:"",//歌曲信息，里面有ID用来获取歌曲url
    sheetList:[],//歌单数据
    loginInfo:{}
  },
  mutations: {
    setSongId(state,params){
      state.songItem = params
    },
    setSheetList(state,params){
      state.sheetList = params
    },
    loginInfo(state,params){
      state.loginInfo = params
    }
  },
  actions: {
    setSongId({commit},params){
      commit('setSongId',params)
    },
    setSheetList({commit},params){
      commit('setSheetList',params)
    },
    loginInfo({commit},params){
      commit('loginInfo',params)
    }
  },
  getters: {
    getSongItem: state => state.songItem,
    getSheetList: state => state.sheetList,
    getLoginInfo: state => state.loginInfo
  },
  modules: {
  }
})
